knitr::opts_knit$set(root.dir = '../../../')
library(stringr)
library(ggplot2)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
Load data
data <- read.table('report/promoter_upstream_downstream_10kb/adultBrain/intersect.CerebrumFrontalOC.bed.gz', sep = '\t', header = F)
v11.good <- is.na(str_match(data$V14, '[ATGC]'))
v11.strategy1 <- str_match(data$V14, '(.+),.+,.+,.+')
v12.good <- is.na(str_match(data$V15, '[ATGC]'))
v12.strategy1 <- str_match(data$V15, '(.+),.+,.+,.+')
strategy1 <- v11.strategy1
strategy1[v12.good, ] <- v12.strategy1[v12.good, ]
# strategy1 <- str_match(data$V12, '(.+),.+,.+,.+')
strategy1 <- strategy1[, 2]
class(strategy1) <- 'numeric'
data <- data.frame(strategy1 = strategy1, centisnp = data$V7, motif = data$V4, position = data$V2, strand = data$V6)
data <- unique(data)
motifs <- unique(data$motif)
Include all motifs
ggplot(data) + geom_point(aes(x = centisnp, y = strategy1)) +
geom_abline(slope = 1, intercept = 0, color = 'red') +
ggtitle('All motifs')

for (i in motifs){
data.sub <- data[data$motif == i, ]
cat('\n')
cat("#", paste('Motif', i), "\n")
# cat("\n")
print(ggplot(data.sub) + geom_point(aes(x = centisnp, y = strategy1)) +
geom_abline(slope = 1, intercept = 0, color = 'red'))
# cat("\n")
cat("\n")
}
Motif M01628

Motif M01504

Motif M01532

Motif PBM0050

Motif M00930

Motif M01122

Motif M01299

Motif M00488

Motif M00337

Motif M01610

Motif M01267

Motif M00926

Motif M00338

Motif MA0018.2

Motif M00981

Motif M00041

Motif M01511

Motif M00443

Motif M01586

Motif M01251

Motif M01941

Motif M01613

Motif M00799

Motif PBM0095

Motif MA0076.1

Motif M01992

Motif M01990

Motif M01988

Motif M01986

Motif M00032

Motif PBM0084

Motif PBM0173

Motif PBM0142

Motif MA0004.1

Motif M01699

Motif M01509

Motif PBM0104

Motif PBM0103

Motif PBM0132

Motif M01057

Motif M01104

Motif M01629

Motif M00008

Motif PBM0054

Motif M00752

Motif PBM0090

Motif M01609

Motif M02040

Motif MA0055.1

Motif M01302

Motif M01634

Motif M00797

Motif M00359

Motif M01709

Motif M00806

Motif M00193

Motif MA0119.1

Motif M01196

Motif M01972

Motif M01219

Motif M00916

Motif M00513

Motif M00017

Motif M01187

Motif M00179

Motif M00178

Motif M01863

Motif M01862

Motif M01861

Motif M00917

Motif M00691

Motif M00942

Motif M00737

Motif M01186

Motif M01812

Motif M00466

Motif M00976

Motif M01208

Motif M01979

Motif M01163

Motif M00262

Motif M00108

Motif M00940

Motif M00263

Motif M01951

Motif M00516

Motif M01643

Motif M01558

Motif PBM0118

Motif M01948

Motif M00067

Motif MA0099.2

Motif M00615

Motif M01840

Motif M00163

Motif M00220

Motif PBM0125

Motif M01034

Motif M01577

Motif M00307

Motif M01938

Motif M00036

Motif M01820

Motif M00113

Motif M00946

Motif M00944

Motif M00694

Motif M00375

Motif M00039

Motif M00121

Motif M00369

Motif M00187

Motif M00739

Motif M00736

Motif M00388

Motif M00357

Motif PBM0031

Motif M01548

Motif M00404

Motif M00936

Motif M00376

Motif M01259

Motif M01200

Motif MA0028.1

Motif M01078

Motif M00490

Motif M00428

Motif MA0060.1

Motif M00287

Motif M01916

Motif M01909

Motif M01968

Motif M01947

Motif M00660

Motif MA0058.1

Motif M00024

Motif M00425

Motif M00236

Motif M01065

Motif M00305

Motif M01946

Motif M00517

Motif M00122

Motif M01793

Motif M01759

Motif M01304

Motif M01779

Motif M00069

Motif PBM0013

Motif PBM0200

Motif M00371

Motif M00370

Motif M01742

Motif M00652

Motif M00188

Motif M01615

Motif PBM0199

Motif PBM0197

Motif M01256

Motif M00325

Motif M00256

Motif M01028

Motif MA0139.1

Motif M00983

Motif M00422

Motif M01054

Motif M00288

Motif M00119

Motif MA0138.2

Motif MA0088.1

Motif M01701

Motif M01827

Motif M00821

Motif MA0150.1

Motif M00171

Motif M00281

Motif MA0027.1

Motif M01932

Motif M01284

Motif M00279

Motif M00007

Motif M01323

Motif M01465

Motif M00424

Motif M00204

Motif M01666

Motif M02014

Motif M01819

Motif M01911

Motif M00284

Motif M00398

Motif M00210

Motif M01788

Motif M00734

Motif PBM0156

Motif PBM0140

Motif M00303

Motif M01138

Motif M01737

Motif PBM0038

Motif M01483

Motif M01471

Motif M01354

Motif M01353

Motif M01971

Motif M00510

Motif M00795

Motif PBM0039

Motif M00280

Motif M00199

Motif M00407

Motif M00129

Motif M01864

Motif M01316

Motif M01473

Motif PBM0192

Motif PBM0187

Motif M00117

Motif M01768

Motif MA0035.2

Motif MA0135.1

Motif M01345

Motif M00195

Motif M00342

Motif M00045
